home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / UNIXLIB37B / !UnixLib37 / src / unix / c / link < prev    next >
Text File  |  1996-11-09  |  955b  |  40 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/link,v $
  4.  * $Date: 1996/10/30 21:59:01 $
  5.  * $Revision: 1.2 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: link,v $
  10.  * Revision 1.2  1996/10/30 21:59:01  unixlib
  11.  * Massive changes made by Nick Burret and Peter Burwood.
  12.  *
  13.  * Revision 1.1  1996/04/19 21:35:27  simon
  14.  * Initial revision
  15.  *
  16.  ***************************************************************************/
  17.  
  18. static const char rcs_id[] = "$Id: link,v 1.2 1996/10/30 21:59:01 unixlib Rel $";
  19.  
  20. #include <errno.h>
  21. #include <unistd.h>
  22. #include <sys/os.h>
  23.  
  24. int
  25. link (const char *origfile, const char *newfile)
  26. {
  27.   _kernel_oserror *e;
  28.   char *ofile, *nfile;
  29.  
  30.   ofile = __uname ((char *)origfile, 0);
  31.   nfile = __uname ((char *)newfile, 1);
  32.  
  33.   if (e = os_fsctrl (25, ofile, nfile, 0))
  34.     {
  35.       __seterr (e);
  36.       return (-1);
  37.     }
  38.   return (0);
  39. }
  40.